
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

void *thread_run(void *arg)
{
		int i=5;
		while(i--){
			printf("I am %s\n",(char *)arg);
			sleep(1);
		}
		//终止线程
		return (void*)1;//方式一
		//pthread_exit((void *)1);//方式二
}

int main()
{
	pthread_t tid;
	void *ret;
	pthread_create(&tid,NULL,thread_run,NULL);
	pthread_join(tid,&ret);
	
	printf("main thread run new thread ret:%d\n",(int)ret);
	return 0;
}
